home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 9 / Night Owl CD-ROM (NOPV9) (Night Owl Publisher) (1993).ISO / 004a / pbclon21.zip / MENUDEMO.BAS < prev    next >
BASIC Source File  |  1993-01-11  |  2KB  |  53 lines

  1. '   +----------------------------------------------------------------------+
  2. '   |                                                                      |
  3. '   |       PBClone  Copyright (c) 1990-1993  Thomas G. Hanlin III         |
  4. '   |                                                                      |
  5. '   +----------------------------------------------------------------------+
  6.  
  7. ' This is another simple demo of the PBClone routines, BarMenu in specific.
  8. ' It offers you a choice between five options via a bar-type menu.
  9. ' Typically, this would be converted to an .EXE file using these steps:
  10. '    BC MENUDEMO/O;
  11. '    LINK MENUDEMO/EX,,NUL,PBCLONE;
  12.  
  13.    DECLARE SUB BarMenu (PickList$(), Row%, LCol%, RCol%, Attr%, HiAttr%, PromptSt$)
  14.    DECLARE SUB CalcAttr (BYVAL Fore%, BYVAL Back%, Attr%)
  15.  
  16.    DEFINT A-Z
  17.  
  18.    DIM PickList$ (1 TO 10)
  19.  
  20.    COLOR 7, 0
  21.    CLS
  22.  
  23.    PickList$(1) = "Alpha"
  24.    PickList$(2) = "Beta"
  25.    PickList$(3) = "Gamma"
  26.    PickList$(4) = "Delta"
  27.    PickList$(5) = "Epsilon"
  28.    PickList$(6) = "Zeta"
  29.    PickList$(7) = "eTa"
  30.    PickList$(8) = "tHeta"
  31.    PickList$(9) = "Iota"
  32.    PickList$(10) = "Kappa"
  33.  
  34.    LOCATE 3, 1, 0
  35.    PRINT "This is a brief demo of the BarMenu routine.  As you might guess, it provides"
  36.    PRINT "support for bar-style menus.  You can use the left and right arrows, space"
  37.    PRINT "and backspace, or tab and back-tab to move the highlight.  If you prefer,"
  38.    PRINT "you can just press the first capitalized letter in the name of your choice."
  39.    PRINT "The <ESC> key aborts without picking anything."
  40.  
  41.    CalcAttr 7, 1, Attr
  42.    CalcAttr 15, 1, HiAttr
  43.    Row = 1
  44.    BarMenu PickList$(), Row, 0, 0, Attr, HiAttr, "Pick One: "
  45.  
  46.    LOCATE 10, 1
  47.    IF Row THEN
  48.       PRINT "You picked item"; STR$(Row); ", which is ";
  49.       PRINT CHR$(34); PickList$(Row); CHR$(34)
  50.    ELSE
  51.       PRINT "You pressed <ESC>, so no item was selected."
  52.    END IF
  53.